package io.adrainty.algorithm.mars;

import java.util.Arrays;

/**
 * 找出整形数组中占比超过一半的元素
 * @link <a href="https://www.marscode.cn/practice/364l85wv6oo6lq?problem_id=7414004855077847084">...</a>
 * @author adrainty
 * @version v1.0.0
 * @since 2024/11/22 上午10:49
 */
public class Solution008 {

    private Solution008() {}

    public static int solution(int[] array) {
        // Edit your code here
        Arrays.sort(array);
        return array[array.length / 2];
    }

}
